package cn.gao.enums.child;

import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.concurrent.atomic.AtomicBoolean;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: GaoXu
 * @Date: 2022/05/20/17:17
 * @Description:
 */
public enum VideoTypeEnum {

    MOV("mov"),
    MP4("mp4"),
    AVI("avi"),
    WMV("wmv"),
    m4v("m4v"),
    ;

    private String typeName;

    VideoTypeEnum(String typeName) {
        this.typeName = typeName;
    }

    public static boolean contains(String type) {
        AtomicBoolean flag = new AtomicBoolean(false);
        Arrays.stream(VideoTypeEnum.values()).forEach(e -> {
            if (StringUtils.equals(type, e.typeName)) {
                flag.set(true);
            }
        });
        return flag.get();
    }
}
